package com.czx.entity;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;


@Data
public class MyPage<T> extends Page<T> {

    private String path;

    public Long getFrom() {
        long index =super.current-2;
        if(index<=0){
            return 1L;
        }
        return index;
    }

    public Long getTo() {
        long index =super.current+2;
        if(index>=super.getPages()){
            return super.getPages();
        }
        return index;
    }

    public MyPage() {
        super.setSize(4);
    }

}
